package com.heliming.data.entity;

import java.sql.Timestamp;
import java.util.Date;
import java.util.UUID;

import com.heliming.data.utils.CommonUtils;

public class BaseEntity {
	
	private String id;

	private Timestamp createTime;
	
	private Integer rowStatus;	
	
	public void changeStatus(String method, String username) {
		if (method.equals(CommonUtils.METHOD_ADD)) {
			this.id = uuid();
			this.createTime = new Timestamp(new Date().getTime());
			this.rowStatus = 1;
		}
	}
	
	public String uuid() {
		return UUID.randomUUID().toString().replaceAll("-", "");
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Timestamp getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

	public Integer getRowStatus() {
		return rowStatus;
	}

	public void setRowStatus(Integer rowStatus) {
		this.rowStatus = rowStatus;
	}
	
	
}
